SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[paAgregarIncumbencia]

@GrupoDeIncumbencias INT,
@CargoGenerico INT,
@AsignaturaGenerica INT

AS
SET NOCOUNT ON
IF NOT EXISTS(SELECT * FROM tb_Incumbencias WHERE CargoGenerico = @CargoGenerico AND AsignaturaGenerica = @AsignaturaGenerica AND GrupoIncumbencia = @GrupoDeIncumbencias) BEGIN
		INSERT INTO tb_Incumbencias(GrupoIncumbencia, CargoGenerico, AsignaturaGenerica) VALUES (@GrupoDeIncumbencias, @CargoGenerico, @AsignaturaGenerica)
END
GO
GRANT EXECUTE ON  [dbo].[paAgregarIncumbencia] TO [Juntas]
GO
